package com.hdsx.springboot.servlet;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @author 占贤银
 * time 2024/6/3 23:00
 * description 生命之灯因热情而点燃，生命之舟因拼搏而前行
 */
@WebServlet(urlPatterns = "/indexServlet")
public class IndexServlet extends HttpServlet {

    @Override
    public void service(ServletRequest req, ServletResponse res)
            throws IOException {
        req.setCharacterEncoding("utf-8");
        res.setContentType("text/html;charset=utf-8");
        System.out.println("欢迎走进Springboot2.x世界");
        final PrintWriter writer = res.getWriter();
        writer.print("欢迎走进Springboot2.x世界");
        writer.close();
    }
}
